{{#if state.sourceSecurity}}

  <p>{{t 'code_viewer.no_source_code_displayed_due_to_security'}}</p>

{{else}}

  {{#if state.duplicationsInDeletedFiles}}
    <p class="marginbottom10 js-duplications-in-deleted-files">{{t 'duplications.dups_found_on_deleted_resource'}}</p>
  {{/if}}

  {{#if issuesLimitReached}}
    <p class="message-alert marginbottom10">{{tp 'component_viewer.issues_limit_reached' issuesLimit}}</p>
  {{/if}}

  <table class="code">
    {{#if showZeroLine}}
      <tr class="row row-hidden" data-line-number="0" id="{{uid}}-0">
        {{#if settings.coverage}}
          <td class="stat coverage-tests"></td>
          <td class="stat coverage-conditions"></td>
        {{/if}}
        {{#if settings.duplications}}
          <td class="stat"></td>
        {{/if}}
        {{#if settings.scm}}
          <td class="stat"></td>
        {{/if}}
        <td class="stat lid"></td>
        <td class="line"></td>
      </tr>
    {{/if}}

    {{#each source}}
      {{#if show}}
        <tr class="row" data-line-number="{{lineNumber}}" id="{{../../uid}}-{{lineNumber}}">

          {{#if ../../settings.scm}}
            <td class="stat {{#if scm}}scm{{/if}}">
              {{#if scm}}
                {{#ifSCMChanged ../../../../source ../../../lineNumber}}
                  <span class="scm-date">{{scm.date}}</span>
                  <span class="scm-author" title="{{scm.author}}">{{scm.author}}</span>
                {{/ifSCMChanged}}
              {{/if}}
            </td>
          {{/if}}

          {{#if ../../settings.duplications}}
            <td class="stat duplications">
              {{#each duplications}}
                <span class="duplication {{#if this}}duplication-exists{{/if}}" data-index="{{this}}"></span>
              {{/each}}
            </td>
          {{/if}}

          {{#if ../../settings.coverage}}
            <td class="stat {{#if coverage}}coverage-{{#if coverage.covered}}green{{else}}red{{/if}}{{/if}}">
              {{#if coverage}}
                <span class="coverage-tests" title="{{tp 'coverage_viewer.line_covered_by_x_tests' coverage.testCases}}">
                  {{coverage.testCases}}
                </span>
              {{/if}}
            </td>

            <td class="stat {{#if coverage}}{{#if coverage.branchCoverageStatus}}coverage-{{coverage.branchCoverageStatus}}{{/if}}{{/if}}">
              {{#if coverage}}
                {{#if coverage.branches}}
                  <span class="coverage-branches" title="{{tp 'coverage_viewer.x_covered_branches' coverage.coveredBranches}}">
                    {{coverage.coveredBranches}}/{{coverage.branches}}
                  </span>
                {{/if}}
              {{/if}}
            </td>
          {{/if}}

          <td class="stat lid js-line-actions" title="{{t 'component_viewer.line_actions'}}">{{lineNumber}}</td>

          <td class="line"><pre>{{{code}}}</pre></td>
        </tr>
      {{/if}}
    {{/each}}
  </table>

{{/if}}
